home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Scope
/
Scope Disk #078 (199x)(Scope PD)(US)[WB].zip
/
Scope Disk #078 (199x)(Scope PD)(US)[WB].adf
/
SpeedUp
/
speedup.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-06-29
|
1KB
|
56 lines
#include <exec/types.h>
#include <exec/io.h>
#define print(x) Write(stdout,x,sizeof(x))
extern long stdout,stdin;
struct Port *diskport,*CreatePort();
struct IOStdReq *diskreq,*CreateStdIO();
char open,ob[10];
main(argc,argv)
int argc;
char **argv;
{
register long *l,v,d=0;;
if(strcmp(argv[1],"?")==0){
print("Format: speedup [df1:] [speed]\n");
exit(0);
}
diskport=CreatePort(0,0);
diskreq=CreateStdIO(diskport);
if(strcmp(argv[1],"df1:")==0){
argv++;
d=1;
}
open=OpenDevice("trackdisk.device",d,diskreq,0);
if(diskport && diskreq && !open){
l=(long *)(diskreq->io_Unit)+11;
print("\n\nTrackdisk steprate utility\n--------------------------\n");
print("Written in June '87 by M.Kegelmann\n\n");
print("Old value: ");
itoh(*l,ob);
aprints(stdout,ob);
if(argc>d+1){
v=htoi(*++argv);
if(v<0x500) print("Illegal operand.\n");
else {
*l=v;
print(" changed to value:");
aprints(stdout,*argv);
print("\n");
}
}
else do{
print(" New value (>=500):");
getlcli(stdin,ob,8);
if(*ob!='\0')
*l=htoi(ob);
print("\n");
}while(*l<0x500);
}
if(open==0) CloseDevice(diskreq);
if(diskreq) DeleteStdIO(diskreq);
if(diskport) DeletePort(diskport);
}